package palms.exceptions;

import java.io.IOException;
import java.net.Socket;

import palms.security.PalmsSecurityManager;

public class ErrorMessage extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5415523172803799892L;

	private String errormsg;
	
	public ErrorMessage(String error){
		this.setErrormsg(error);
	}
	
	public void setErrormsg(String errormsg) {
		this.errormsg = errormsg;
	}

	public String getErrormsg() {
		return errormsg;
	}

	public void sendTroughSocket(Socket s) throws IOException{
		PalmsSecurityManager.sendObjectTroughtSocket(s, this);
	}

	public String toString(){
		return getErrormsg();
	}
}
